import rainfallRegulativePots from "@/views/rainfallRegulative/data.json";
import waterDevPots from "@/views/waterDev/data.json";
import autoMedicateDevPots from "@/views/autoMedicateDev/data.json";
import sludgeTreatmentDevPots from "@/views/sludgeTreatmentDev/data.json";

// 通过编码查询雨水调节池定位数据
export const selectRainfallRegulativePotByCode = (code) => {
  let pots = rainfallRegulativePots.paramPots.concat(
    rainfallRegulativePots.valvePots
  );

  return pots.find((item) => {
    return item.code === code;
  });
};

// 通过编码查询高效水处理设备定位数据
export const selectWaterDevPotByCode = (code) => {
  let pots = waterDevPots.paramPots.concat(waterDevPots.valvePots);

  return pots.find((item) => {
    return item.code === code;
  });
};

// 通过编码查询雨水调节池定位数据
export const selectAutoMedicateDevPotByCode = (code) => {
  let pots = autoMedicateDevPots.paramPots.concat(
    autoMedicateDevPots.valvePots
  );

  return pots.find((item) => {
    return item.code === code;
  });
};

// 通过编码查询雨水调节池定位数据
export const selectSludgeTreatmentDevPotByCode = (code) => {
  let pots = sludgeTreatmentDevPots.paramPots.concat(
    sludgeTreatmentDevPots.valvePots
  );

  return pots.find((item) => {
    return item.code === code;
  });
};
